<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="toTop" content="true">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link rel="stylesheet" href="./Public/Home/css/xgdz.css"/>
<link rel="stylesheet" href="./Public/Home/css/dz.css"/>
<script src="./Public/Home/js/area.js" type="text/javascript"></script>
<!--头部公共部分调用-->
{{include file="VIEW_PATH/Common/header.php"}}

<!--内容区域开始-->
<div class="xgdz-1">
	<h1>填写并核对订单信息</h1>
</div>
<div class="xgdz-2">
	<h4>收货人信息</h4>
	<a href="javascript:;" class="addr1">添加新地址</a>
</div>
{{foreach from="$dzdata" value="$v"}}
<div class="xgdz-3">
	<dl>
		<dt>
		 <dd class="dd address"><a href="javascript:;">{{$v['adname']}}&nbsp;&nbsp;&nbsp;{{$v['region'][0]}}</a></dd>
		 <dd class="dd dd-1 adname">{{$v['adname']}}</dd>
		 <dd class="dd dd-2 region">
		 	<span>{{$v['region'][0]}}</span>
		 	<span>{{$v['region'][1]}}</span>
		 	<span>{{$v['region'][2]}}</span>
		 	<span>{{$v['adresse']}}</span>
		 </dd>
		 <dd class="dd dd-1 phone">{{$v['phone']}}</dd>
		</dt>
	</dl>
</div>
{{endforeach}}
<div class="xgdz-2">
	<h4>支付信息</h4>
</div>
<div class="xgdz-3">
	<dl>
		<dt>
		 <dd class="dd"><a href="">在线支付</a></dd>
		</dt>
	</dl>
</div>
<div class="xgdz-2">
	<h4>确认订单信息</h4>
</div>
{{foreach from="$arr" value="$v"}}
<div class="psfs">
	<h6>配送方式：</h6>
</div>
<div class="xgdz-3 fg">
	<dl>
	   <dd class="dd"><a href="">快递配送 (免运费)</a></dd>
	   <dd class="dd-1">商家：<a href=""> 优酷店</a></dd>
	   <dd class="dt-10">
		   	<span class="span">单价（元）</span>
		    <span class="span span-1">数量</span>
		    <span class="span span-1">优惠</span>
		    <span class="span span-2">小计（元）</span>
	   </dd>
	   <dd class="dt-20">
	   	   <span class="span-10"><a href=""><img src="{{$v['photo']}}"/></a></span>
	   	   <span class="span-11">
	   	   	<p><a href="">{{$v['name']}}</a></p><span style="color: #CCCCCC;">类型：</span>
	   	   	{{foreach from="$v['options']" value="$vv"}}
	   	    <span style="padding-right: 10px; color: #CCCCCC;">{{$vv}}</span>
	   	    {{endforeach}} 
	   	   </span>
	   	   <span class="span">{{$v['price']}}</span>
		   <span class="span span-1 shuliang">{{$v['num']}}</span>
		   <span class="span span-1">0</span>
		   <span class="span allspan">{{$v['total']}}</span> 
       </dd>
	</dl>
</div>
<form action="{{U('Order/add',array('sids'=>Q('get.sids')))}}" method="post">
<div class="xgdz-4">
	<h6>留言：</h6>
	<div><textarea name="oremarks[]" id="" ></textarea></div>
	<div class="all">
		<span>店铺合计：</span>
		<span class="all-1">￥{{$v['total']}}</span>
	</div>
</div>
{{endforeach}}

<div class="xgdz-2">
	<h4>开具发票</h4>
</div>
<div class="xgdz-10">
<input class="chk" value="1" type="checkbox">
	开具发票（普通发票 / <span class="title">
		个人</span> / <span class="content">明细</span>）
<a href="#" class="btn-link modify">修改</a>
</div>
<div class="xgdz-20">
	<div class="total">
		<dl><dt>商品数量：</dt>
			<dd><span class="count">0</span> 件</dd>
		</dl>
		<dl><dt>金额合计：</dt>
			<dd><span class="amount">0</span> 元</dd>
		</dl>
		<dl><dt>优惠：</dt>
			<dd><span class="youhui">0</span> 元</dd>
		</dl>
		<dl><dt>运费：</dt>
			<dd><span class="transcost">0</span> 元</dd>
		</dl>
	</div>
</div>
<div class="xgdz-30">
       应付总额：<span style="color: #EE4C23; font-size: 25px;">￥</span>	
       <em class="pay fn-rmb">0</em>
       <input type="hidden" name="oaddress" id="" value="" />
       <input type="hidden" name="oname" id="" value="" />
       <input type="hidden" name="sids" id="" value="{{Q('get.sids')}}" />
       <button type="submit" class="btn btn-primary submit">提交订单</button>
</div>
</form>

<div class="delivery">
	<p class="addr">寄送至：
		<span class="jcdzzz"></span>
		
	</p>
	<p class="addressee">收件人：
		<span class="jcrmzz"></span>
	</p>
</div>
<!--内容区域结束-->
<div id='yingchang' style=" display: none; width: 100%;height: 100%; position:fixed;top: 0;left: 0; background: rgba(0,0,0,0.5);">
<div id="tankuang">
	<div class="top">
		<span class="span-1">新增收货地址</span>
		<span class="glyphicon glyphicon-remove" id="clos" style="cursor: pointer; font-size: 20px; float: right; " aria-hidden="true"></span>
	</div>
	<div class="content" style="padding-top: 30px;">
		<form class="form-horizontal" method="post" action="{{U('Address/add',array('sids'=>Q('get.sids')))}}">
			<div class="form-group">
				<label for="input3" class="col-sm-2 control-label">*收获人：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="adname"  placeholder="收获人">
				</div>
			</div>
			<div class="form-group">
				<label for="input3" class="col-sm-2 control-label">身份证号：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="adnumber"  placeholder="身份证号">
				</div>
			</div><div class="form-group">
				<label for="input3" class="col-sm-2 control-label">所在地区：</label>
				<div class="col-sm-10">
					<!--<input type="" class="form-control" id="input3"  placeholder="所在地区">-->
						<select name="region[]" id="area1" class="area"></select>
	                    <select name="region[]" id="area2" class="area"></select>
	                    <select name="region[]" id="area3" class="area"></select>
				</div>
			</div><div class="form-group">
				<label for="input3" class="col-sm-2 control-label">*详细地址：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="adresse" placeholder="详细地址">
				</div> 
			</div><div class="form-group">
				<label for="input3" class="col-sm-2 control-label">*手机号吗：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="phone"  placeholder="手机号吗">
				</div>
			</div><div class="form-group">
				<label for="input3" class="col-sm-2 control-label">固定电话：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="telephone"  placeholder="固定电话">
				</div>
			</div><div class="form-group">
				<label for="input3" class="col-sm-2 control-label">邮政编码：</label>
				<div class="col-sm-10">
					<input type="" class="form-control" id="input3" name="zipcode"  placeholder="邮政编码">
				</div>
			</div>
			<div class="form-group" style="padding: 30px 445px;">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-default">提交</button>
				</div>
			</div>
		</form>
	</div>
</div>
</div>
<script type="text/javascript">
$(function(){
		//点击显示添加新地址框
		$(".addr1").click(function(){
	       $("#yingchang").fadeIn();
	    });
	//  点击关闭添加框
		$("#clos").click(function(){
		    $("#yingchang").fadeOut();
		});
	//	城市异动选择
		$(function(){
			//初始化方法
			area.init('area');
			//修改的时候默认被选中效果
			area.selected('','','');
		})
		//获得总价格
		var a=0
		$.each($('.allspan'), function() {
//			设置浮点数或整数
			a+=parseFloat($(this).text());
		});
		
		//获得总数量
		var b=0;
		$.each($('.shuliang'), function() {
			//设置浮点数或整数
			b+=parseFloat($(this).text());
		});
		//分配到页面总价
		  $('.amount').text(a);
		  $('.pay').text(a);
		//分配到页面总数
		  $('.count').text(b);
		  
//		点击选择那个地址就付给购买地址
         $('.address').click(function(){
//       	抓取购买人
         	var adname=$(this).siblings('.adname').text();
//       	抓取地址

            var region=$(this).siblings('.region').text();
//       	
//       	抓取电话
         	var phone=$(this).siblings('.phone').text();
//       	选中地址加class样式
            $(this).addClass('dddd').parents('.xgdz-3').siblings('.xgdz-3').find('.address').removeClass('dddd');
//       	付给购买地址和收货人
         	$('.jcdzzz').text(region);
         	$('.jcrmzz').text(adname+"："+phone);
//       	给隐藏域赋值  地址和收货人
         	$('[name=oaddress]').val(region);
         	$('[name=oname]').val(adname);
        })
})

</script>
<!--调用尾部公用-->
{{include file="VIEW_PATH/Common/end.php"}}
</body>
</html>
